package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow.cmdb;

import com.glsc.ngateway.common.base.domain.mysql.cmdb.CmdbCpuStandard;
import com.glsc.ngateway.common.base.domain.mysql.cmdb.CmdbMemoryStandard;
import com.glsc.ngateway.common.base.domain.mysql.gateway.FlowFormBaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author liwei
 * @date 2023/8/2-14:44
 * 新增的设备规格明细数据
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_gw_flow_form_device_standard_new_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_gw_flow_form_device_standard_new_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_gw_flow_form_device_standard_new_detail")
@org.hibernate.annotations.Table(appliesTo = "t_gw_flow_form_device_standard_new_detail", comment = "新增的device规格明细数据-配件规格变更流程子表")
public class FlowFormNewDeviceStandardDetail extends FlowFormBaseEntity {

    @Column(name = "modify_type", columnDefinition = "varchar(10) comment '业务类型:0-新增,1-删除'")
    private String modifyType;

    @Column(name = "brand", length = 100, columnDefinition = "varchar(100) comment '品牌'")
    private String brand;

    @Column(name = "model", length = 100, columnDefinition = "varchar(100) comment '型号'")
    private String model;

    @Column(name = "u_amount", columnDefinition = "int comment 'U数'")
    private Integer uAmount;

    @Column(name = "cpu_port_amount", columnDefinition = "int comment 'CPU路数'")
    private Integer cpuPortAmount;

    @Column(name = "memory_port_amount", columnDefinition = "int comment '内存槽位数'")
    private Integer memoryPortAmount;

    @Column(name = "disk_port_amount", columnDefinition = "int comment '硬盘槽位数'")
    private Integer diskPortAmount;

    @Column(name = "pci_port_amount", columnDefinition = "int comment 'Pci插槽数'")
    private Integer pciPortAmount;

    @Column(name = "ele_port_amount", columnDefinition = "int comment '电源接口数'")
    private Integer elePortAmount;

    @Column(name = "standard_name", length = 100, columnDefinition = "varchar(100) comment '规格名称'")
    private String standardName;

    @Column(name = "device_standard_code", length = 100, columnDefinition = "varchar(100) comment '设备编码-更新使用'")
    private String deviceStandardCodeFlow;


    @Transient
    private CmdbCpuStandard cpuStandard;
    @Transient
    private CmdbMemoryStandard memoryStandard;

    //cpu
    @Transient
    private String cpuStandardCode;
    @Transient
    private String cpuStandardName;
    @Transient
    private Integer cpuAmount;
    @Transient
    private Integer cpuDeviceRelateId;


    //内存
    @Transient
    private String memoryStandardCode;
    @Transient
    private String memoryStandardName;
    @Transient
    private Integer memoryAmount;
    @Transient
    private Integer memoryDeviceRelateId;

    //磁盘
    @Transient
    List<FlowFormNewDeviceDiskStandardDetail> diskStandardRelate;
    //配件
    @Transient
    List<FlowFormNewDevicePartStandardDetail> partStandardRelate;






}
